{extend name="../../admin/view/main"}

{block name="button"}
<!--{if auth("add")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-open='{:url("add")}'>添加调度员</button>
<!--{/if}-->

<!--{if auth("config")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-modal='{:url("config")}'>默认调度员配置</button>
<!--{/if}-->

{/block}

{block name="content"}
<div class="layui-tab layui-tab-card think-bg-white">
    <div class="layui-tab-content">
        {include file='record/city_docking_config/index_search'}
        <table class="layui-table" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='text-left nowrap'>ID</th>
                <th class='text-left nowrap'>调度员</th>
                <th class='text-left nowrap'>城市</th>
                <th class='text-left nowrap'>使用状态</th>
                <th class="text-left">创建时间</th>
                <th></th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr data-dbclick>
                <td class='text-left nowrap'>{$vo.id|default=''}</td>
                <td class='text-left nowrap'>{$vo.name_docking|default=''}</td>
                <td class='text-left nowrap nosl' data-tips-text="{$vo.city_text}">{$vo.city_text|default=''}</td>
                <td class="text-left nowrap">{if $vo.status eq 0}<span class="color-red">已禁用</span>{elseif $vo.status eq 1}<span class="color-green">已激活</span>{/if}</td>
                <td class='text-left nowrap'>{$vo.create_at|format_datetime}</td>
                <td class='text-left nowrap'>
                    <!--{if auth("edit")}-->
                    <a class="layui-btn layui-btn-sm" data-dbclick data-open='{:url("edit")}?id={$vo.id}' data-title="编辑">编 辑</a>
                    <!--{/if}-->

                    <!--{if auth("state") and $vo.status eq 1}-->
                    <a class="layui-btn layui-btn-warm layui-btn-sm" data-action="{:url('state')}" data-value="id#{$vo.id};status#0">禁 用</a>
                    <!--{elseif auth("state") and $vo.status eq 0}-->
                    <a class="layui-btn layui-btn-warm layui-btn-sm" data-action="{:url('state')}" data-value="id#{$vo.id};status#1">激 活</a>
                    <!--{/if}-->

                    <!--{if auth("remove")}-->
                    <a class="layui-btn layui-btn-danger layui-btn-sm" data-action="{:url('remove')}" data-confirm="确定要删除数据吗?" data-value="id#{$vo.id}">删 除</a>
                    <!--{/if}-->
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
</div>
<style>
    .nosl{
        max-width: 180px;
        white-space: normal;
        text-overflow: ellipsis;
        overflow: hidden;
    }
</style>
{/block}
